<!-- 本期代理团队应收/应付上级明细 -->
<template>
    <div>
        <h2 class="bill-title">本期代理团队应收/应付上级明细</h2>
        <el-table v-loading="loading" element-loading-spinner="el-icon-loading" border size="mini"
            class="small-size-table" :data="[data]" style="width: 100%" :max-height="tableHeight" highlight-current-row
            header-align="center" :header-cell-style="getRowClass">
            <el-table-column prop="teamNetAmount" align="center">
                <template slot="header" slot-scope="{ column, $index }">
                    <span>
                        本期盈亏
                        <el-tooltip class="item" effect="dark" content="汇总德州+体育+真人+电竞+棋牌+彩票+电子+其他八个项目的盈亏之和"
                            placement="top">
                            <i class="el-icon-question"></i>
                        </el-tooltip>
                    </span>
                </template>
                <template slot-scope="scope">
                    <FormItem :scope="scope" :updateData="updateData" />
                </template>
            </el-table-column>
            <el-table-column prop="adjustmentAmount" align="center" label="其他资金变动">
                <template slot="header" slot-scope="{ column, $index }">
                    <span>
                        其他资金变动
                        <el-tooltip class="item" effect="dark" placement="top">
                            <span slot="content">
                                统计非游戏盈亏类目的资金增减变动
                            </span>
                            <i class="el-icon-question"></i>
                        </el-tooltip>
                    </span>
                </template>
                <template slot-scope="scope">
                    <FormItem :scope="scope" :updateData="updateData" />
                </template>
            </el-table-column>
            <el-table-column prop="userName" align="center">
                <template slot="header" slot-scope="{ column, $index }">
                    <span>上期应收上级</span>
                </template>
                <span v-if="
                    data.lastPeriodShouldReceiptPaymentParentAmount >
                    0
                ">
                    {{
                        handleTotalNumber(
                            'USDT',
                            Math.abs(
                                data.lastPeriodShouldReceiptPaymentParentAmount
                            ),
                            2
                        )
                    }}
                </span>
                <span v-else>$0.00</span>
            </el-table-column>
            <el-table-column prop="userName" align="center">
                <template slot="header" slot-scope="{ column, $index }">
                    <span>上期应付上级</span>
                </template>
                <span v-if="
                    data.lastPeriodShouldReceiptPaymentParentAmount <
                    0
                ">
                    {{
                        handleTotalNumber(
                            'USDT',
                            Math.abs(
                                data.lastPeriodShouldReceiptPaymentParentAmount
                            ),
                            2
                        )
                    }}
                </span>
                <span v-else>$0.00</span>
            </el-table-column>
            <el-table-column prop="userName" align="center">
                <template slot="header" slot-scope="{ column, $index }">
                    <span>
                        {{
                            data.shouldPaymentReceiptParentAmount < 0 ? '应付上级' : '应收上级' }} </span>
                            <el-tooltip class="item" effect="dark" placement="top">
                                <p slot="content" v-if="
                                    data.shouldPaymentReceiptParentAmount <
                                    0
                                ">
                                    本期盈亏+其他资金变动+上期应收上级-上期应付上级＜0的金额
                                </p>
                                <p slot="content" v-else>
                                    本期盈亏+其他资金变动+上期应收上级-上期应付上级＞0的金额
                                </p>
                                <i class="el-icon-question"></i>
                            </el-tooltip>
                </template>
                <span>
                    {{
                        handleTotalNumber(
                            'USDT',
                            Math.abs(
                                data.shouldPaymentReceiptParentAmount
                            ),
                            2
                        )
                    }}
                </span>
            </el-table-column>
        </el-table>

    </div>
</template>

<script>
import FormItem from './formItem.vue'
import mixins from './mixin.js'
import list from '@/mixins/list'
export default {
    components: {
        FormItem
    },
    mixins: [list, mixins],
    props: {
        data: {
            type: Object,
            default: {}
        }
    }
}
</script>

<style scoped>
.bill-title {
    text-align: center;
}
</style>
